package cn.edu.fzu.homemaking.domain.enums;

/**
 * @author jiebin
 * @date 2023/4/6
 */
public enum DemandStatusEnum {
    CANCEL(-1,"已取消"),
    WAIT(0,"待接单"),
    ACCEPT(1,"已接单");

    private final int value;

    private final String desc;

    DemandStatusEnum(int value, String desc){
        this.value = value;
        this.desc = desc;
    }

    public int getValue(){
        return value;
    }

    public String getDesc(){
        return desc;
    }

    public static DemandStatusEnum parse(int value){
        switch (value){
            case -1:
                return CANCEL;
            case 0:
                return WAIT;
            case 1:
                return ACCEPT;
            default:
                return null;
        }
    }
}
